package com.fengycx.remote;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fengycx.feign.CustomerFineApi;
import com.fengycx.param.CustomerCancelOrderParam;
import com.fengycx.pojo.domain.CustomerFine;
import com.fengycx.result.R;
import com.fengycx.service.ICustomerFineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;


@RestController
public class CustomerApiImpl implements CustomerFineApi {

    @Autowired
    private ICustomerFineService customerFineService;

    @Override
    public R<Void> customerCancelOrder(CustomerCancelOrderParam param) {
        CustomerFine customerFine = new CustomerFine();
        BeanUtil.copyProperties(param,customerFine);
        customerFine.setStatus(1);
        customerFine.setCreateTime(new Date());
        customerFineService.save(customerFine);
        return R.success();
    }
}
